home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / arcers / gzipsrc.zip / GZIPSRC.TAR / gzip-1.2.4 / Makefile.in < prev    next >
Makefile  |  1993-08-17  |  12KB  |  387 lines

  1. # Makefile for gzip (GNU zip)    -*- Indented-Text -*-
  2. # Copyright (C) 1992-1993 Jean-loup Gailly and the Free Software Foundation
  3.  
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8.  
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. # GNU General Public License for more details.
  13.  
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. # $Id: Makefile.in,v 0.23 1993/06/24 11:51:47 jloup Exp $
  19.  
  20. #### Start of system configuration section. ####
  21.  
  22.  
  23. srcdir = @srcdir@
  24. VPATH = @srcdir@
  25.  
  26. CC = @CC@
  27. ASCPP = @ASCPP@
  28.  
  29. INSTALL = @INSTALL@
  30. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  31. INSTALL_DATA = @INSTALL_DATA@
  32.  
  33. # Things you might add to DEFS (configure usually figures out what to do):
  34. # -DGNU_STANDARD        Behave as gzip even if invoked as gunzip (GNU standard)
  35. # -DDIRENT              Use <dirent.h>  for recursion (-r)
  36. # -DSYSDIR              Use <sys/dir.h> for recursion (-r)
  37. # -DSYSNDIR             Use <sys/ndir.h> for recursion (-r)
  38. # -DNDIR                Use <ndir.h> for recursion (-r)
  39. # -DSTDC_HEADERS        Use <stdlib.h>
  40. # -DHAVE_UNISTD_H    Use <unistd.h>
  41. # -DNO_FCNTL_H          Don't use <fcntl.h>
  42. # -DNO_UTIME_H        Don't use <utime.h>
  43. # -DHAVE_SYSUTIME_H    Use <sys/utime.h>
  44. # -DNO_MEMORY_H         Don't use <memory.h>. Not needed if STDC_HEADERS.
  45. # -DNO_STRING_H         Use strings.h, not string.h. Not needed if STDC_HEADERS
  46. # -DRETSIGTYPE=int      Define this if signal handlers must return an int.
  47. # -DNO_SYMLINK          OS defines S_IFLNK but does not support symbolic links
  48. # -DNO_MULTIPLE_DOTS    System does not allow file names with multiple dots
  49. # -DNO_UTIME        System does not support setting file modification time
  50. # -DNO_CHOWN        System does not support setting file owner
  51. # -DNO_DIR        System does not support readdir()
  52. # -DPROTO        Force function prototypes even if __STDC__ not defined
  53. # -DASMV        Use asm version match.S
  54. # -DMSDOS        MSDOS specific
  55. # -DOS2            OS/2 specific
  56. # -DVAXC        Vax/VMS with Vax C compiler
  57. # -DVMS            Vax/VMS with gcc
  58. # -DDEBUG        Debug code
  59. # -DDYN_ALLOC        Use dynamic allocation of large data structures
  60. # -DMAXSEG_64K        Maximum array size is 64K (for 16 bit system)
  61. # -DRECORD_IO           read() and write() are rounded to record sizes.
  62. # -DNO_STDIN_FSTAT      fstat() is not available on stdin
  63. # -DNO_FSTAT            fstat() is not available
  64. # -DNO_SIZE_CHECK       stat() does not give a reliable file size
  65.  
  66. DEFS = @DEFS@
  67. LIBS = @LIBS@
  68.  
  69. # additional assembly sources for particular systems may be required.
  70. OBJA = @OBJA@
  71.  
  72. SEDCMD = @SEDCMD@
  73.  
  74. CFLAGS = @CFLAGS@
  75. # If you want debug on by default, use: CFLAGS="-g" ./configure
  76. LDFLAGS = $(CFLAGS)
  77.  
  78. G=@G@
  79. # To install znew, zmore, etc... as gznew, gzmore... use: G=g
  80.  
  81. ZCAT=@ZCAT@
  82. # To install zcat executable and man page as gzcat, use: ZCAT=gzcat
  83.  
  84. X=
  85. # For OS/2 or MSDOS, use: X=.exe
  86.  
  87. O=.o
  88. # For OS/2 or MSDOS, use: O=.obj
  89.  
  90. prefix = /usr/local
  91. exec_prefix = $(prefix)
  92.  
  93. bindir = $(exec_prefix)/bin
  94. scriptdir = $(bindir)
  95. # scriptdir is the directory in which shell scripts should be installed
  96. datadir = $(prefix)/lib
  97. libdir = $(prefix)/lib
  98. infodir = $(prefix)/info
  99.  
  100. # Extension (not including `.') for the installed manual page filenames.
  101. manext = 1
  102. # Where to install the manual pages.
  103. mandir = $(prefix)/man/man$(manext)
  104. # Use manlinks=so to use the .so method instead of hard links
  105. manlinks = ln
  106.  
  107. alldirs = $(bindir) $(scriptdir) $(datadir) $(libdir) $(infodir) $(mandir)
  108.  
  109. #### End of system configuration section. ####
  110.  
  111. SHELL = /bin/sh
  112.  
  113. LOADLIBES = $(LIBS)
  114.  
  115. TAR = tar
  116.  
  117. SRCS = gzip.c zip.c deflate.c trees.c bits.c unzip.c inflate.c util.c crypt.c\
  118.        lzw.c unlzw.c unpack.c unlzh.c getopt.c match.S
  119.  
  120. OBJS = gzip$O zip$O deflate$O trees$O bits$O unzip$O inflate$O util$O \
  121.        crypt$O lzw$O unlzw$O unpack$O unlzh$O getopt$O $(OBJA)
  122.  
  123. HDRS = gzip.h lzw.h tailor.h revision.h crypt.h getopt.h
  124.  
  125. GENFILES =  README NEWS INSTALL Makefile.in configure.in configure COPYING \
  126.   TODO THANKS ChangeLog $(SRCS) $(HDRS) zmore.in znew.in zdiff.in zgrep.in \
  127.   zforce.in gzexe.in gzip.1 zdiff.1 zgrep.1 zmore.1 znew.1 gzexe.1 zforce.1 \
  128.   gzip.doc algorithm.doc gzip.texi texinfo.tex gpl.texinfo gzip.info
  129.  
  130. sampleFILES =  sample/makecrc.c sample/zread.c sample/add.c sample/sub.c \
  131.        sample/ztouch sample/zfile
  132.  
  133. msdosFILES = msdos/tailor.c msdos/match.asm msdos/gzip.prj msdos/doturboc.bat \
  134.   msdos/Makefile.msc msdos/Makefile.bor msdos/Makefile.djg
  135.  
  136. os2FILES = os2/Makefile.os2 os2/gzip.def os2/gzip16.def
  137.  
  138. ntFILES = nt/Makefile.nt
  139.  
  140. vmsFILES = vms/Readme.vms vms/Makefile.vms vms/Makefile.gcc vms/makegzip.com \
  141.    vms/Makefile.mms vms/vms.c vms/gzip.hlp
  142.  
  143. amigaFILES = amiga/Makefile.sasc amiga/Makefile.gcc amiga/tailor.c \
  144.   amiga/utime.h amiga/match.a
  145.  
  146. atariFILES = atari/Makefile.st
  147.  
  148. primosFILES = primos/readme primos/primos.c primos/ci.opts \
  149.    primos/build.cpl primos/include/errno.h primos/include/fcntl.h \
  150.    primos/include/stdlib.h primos/include/sysStat.h primos/include/sysTypes.h
  151.  
  152. DISTFILES = $(GENFILES) $(sampleFILES) $(msdosFILES) $(os2FILES) $(ntFILES)\
  153.    $(vmsFILES) $(amigaFILES) $(atariFILES) $(primosFILES)
  154.  
  155. SCRIPTS = $(G)zdiff $(G)zgrep $(G)zmore $(G)znew $(G)zforce gzexe
  156.  
  157. .c$O:
  158.     $(CC) -c $(DEFS) $(CFLAGS) $<
  159.  
  160. #.PHONY: default all force test check
  161.  
  162. default:  gzip$X
  163. all:    gzip$X $(G)zdiff $(G)zgrep $(G)zmore $(G)znew $(G)zforce gzexe
  164. force:
  165.  
  166. #### Start of specific targets section. ####
  167. #
  168. # 'configure' works only on Unix systems. For other systems able to make
  169. # sense of this makefile, you can define target specific entries here.
  170. # For other systems such as MSDOS, separate Makefiles are
  171. # provided in subdirectories.
  172.  
  173. # NeXT 2.x, 3.0, 3.1 thin. For gcc, replace -bsd with -D__STRICT_BSD__.
  174. next:
  175.     $(MAKE) all CFLAGS="-O -bsd -DASMV" \
  176.     DEFS="-DNO_STDLIB_H -DNO_STRING_H -DNO_UTIME_H -DSYSDIR -DRETSIGTYPE=int"
  177.  
  178. # NeXT 3.1 fat (68k + 386). For gcc, replace -bsd with -D__STRICT_BSD__.
  179. next-fat:
  180.     $(MAKE) all OBJA=match-next.o \
  181.     CFLAGS="-O2 -bsd -DASMV -fno-builtin -arch m68k -arch i386" \
  182.     DEFS="-DNO_STDLIB_H -DNO_STRING_H -DNO_UTIME_H -DSYSDIR -DRETSIGTYPE=int"
  183.  
  184. match-next.o: match.S
  185.     cat $(srcdir)/match.S > match-next.s
  186.     $(CC) -arch m68k -arch i386 -c match-next.s
  187.     rm -f match-next.s
  188.  
  189. # gcc with emx 0.8f kit (use by preference os2/Makefile.os2)
  190. os2_gcc:
  191.     $(MAKE) all CC=gcc CFLAGS="-O -DOS2" X=".exe"
  192.  
  193. # Xenix 2.3.2 for 286:
  194. xenix_286:
  195.     $(MAKE) all CFLAGS="-LARGE -M2l"
  196.  
  197. # Coherent (with broken /bin/sh):
  198. coherent:
  199.     $(MAKE) all OBJA=match.o DEFS=\
  200.     "-DASMV -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 -DDIRENT=1"
  201.  
  202. #### End of specific targets section. ####
  203.  
  204. install: installdirs installbin installman
  205.  
  206. installbin: all
  207.     $(INSTALL_PROGRAM) gzip$X $(bindir)/gzip$X
  208.     for f in $(SCRIPTS); do \
  209.       $(INSTALL_PROGRAM) $${f} $(scriptdir)/$${f}; done
  210.     rm -f $(scriptdir)/$(G)zcmp; \
  211.       ln $(scriptdir)/$(G)zdiff $(scriptdir)/$(G)zcmp
  212.     for f in gunzip$X ungzip$X $(ZCAT)$X ; do \
  213.       rm -f $(bindir)/$${f}; done
  214.     @if echo $(DEFS) | grep GNU_STANDARD > /dev/null; then \
  215.       echo 'exec gzip -d  $${1+"$$@"}' > $(bindir)/gunzip$X; \
  216.       echo 'exec gzip -dc $${1+"$$@"}' > $(bindir)/$(ZCAT)$X; \
  217.       chmod 755 $(bindir)/gunzip$X  $(bindir)/$(ZCAT)$X; \
  218.     else \
  219.       ln $(bindir)/gzip$X $(bindir)/gunzip$X; \
  220.       ln $(bindir)/gzip$X $(bindir)/$(ZCAT)$X; \
  221.     fi
  222.  
  223. installman: gzip.info
  224.     for f in gzip gunzip $(ZCAT) $(SCRIPTS) $(G)zcmp; do \
  225.       rm -f $(mandir)/$${f}.$(manext); done
  226.     -cd $(srcdir); for f in gzip gzexe; do \
  227.       $(INSTALL_DATA) $${f}.1 $(mandir)/$${f}.$(manext); done
  228.     -cd $(srcdir); for f in zdiff zgrep zmore znew zforce; do \
  229.       $(INSTALL_DATA) $${f}.1 $(mandir)/$(G)$${f}.$(manext); done
  230.     -cd $(mandir); if test $(manlinks) = so; then \
  231.       echo .so man$(manext)/gzip.$(manext)      > $(ZCAT).$(manext);\
  232.       echo .so man$(manext)/$(G)zdiff.$(manext) > $(G)zcmp.$(manext);\
  233.       echo .so man$(manext)/gzip.$(manext)      > gunzip.$(manext);\
  234.       chmod 644 $(ZCAT).$(manext) $(G)zcmp.$(manext) gunzip.$(manext);\
  235.     else \
  236.       ln gzip.$(manext)  $(ZCAT).$(manext);\
  237.       ln $(G)zdiff.$(manext) $(G)zcmp.$(manext);\
  238.       ln gzip.$(manext)  gunzip.$(manext);\
  239.     fi
  240.     -cd $(srcdir); for f in gzip.info* ; do $(INSTALL_DATA) $${f} \
  241.       $(infodir)/$${f}; done
  242.  
  243. uninstall: force
  244.     -cd $(bindir); rm -f gzip$X gunzip$X $(ZCAT)$X
  245.     -cd $(scriptdir); rm -f $(SCRIPTS) $(G)zcmp
  246.     -for f in gzip gunzip $(ZCAT) $(SCRIPTS) $(G)zcmp; do \
  247.       rm -f $(mandir)/$${f}.$(manext); done
  248.     -cd $(infodir); rm -f gzip.info*
  249.  
  250. # install all files and replace compress (not recommended)
  251. install_compress: install
  252.     -test -f $(bindir)/compress.old || \
  253.       mv $(bindir)/compress$X $(bindir)/compress.old
  254.     ln $(bindir)/gzip$X $(bindir)/compress$X
  255.     rm -f $(bindir)/uncompress$X
  256.     ln $(bindir)/gzip$X $(bindir)/uncompress$X
  257.  
  258. # Make sure all installation directories, e.g. $(bindir) actually exist by
  259. # making them if necessary. At most one level is created (except for man).
  260. installdirs:
  261.     -if test ! -d $(prefix)/man; then \
  262.        mkdir $(prefix)/man; fi
  263.     -for dir in $(alldirs) ; do \
  264.        if test ! -d $${dir}; then \
  265.          mkdir $${dir}; fi; \
  266.     done
  267.  
  268. test: check
  269. check:    gzip$X
  270.     ./gzip -6 < $(srcdir)/texinfo.tex > _gztest.gz
  271.     @LANG=""; export LANG; if test `wc -c < _gztest.gz` -eq 30890; then \
  272.        true; \
  273.     else \
  274.        echo FAILED gzip test: incorrect size; \
  275.     fi
  276.     rm -f _gztest
  277.     ./gzip -d _gztest.gz
  278.     @if cmp _gztest $(srcdir)/texinfo.tex; then \
  279.        echo gzip test OK; \
  280.     else \
  281.        echo FAILED gzip test: incorrect decompress; \
  282.     fi
  283.     rm -f _gztest*
  284.  
  285. TAGS: $(SRCS) $(HDRS)
  286.     cd $(srcdir); etags $(SRCS) $(HDRS)
  287.  
  288. Makefile: Makefile.in ./config.status
  289.     ./config.status
  290.  
  291. ./config.status: configure
  292.     $(srcdir)/configure --srcdir=$(srcdir) --no-create
  293.  
  294. configure: configure.in
  295.     @echo Warning: configure is out of date
  296. #    cd $(srcdir); autoconf
  297.  
  298. clean:
  299.     rm -f *$O gzip$X gunzip$X ungzip$X $(ZCAT)$X add$X sub$X a.out core
  300.     rm -f $(G)zcmp $(SCRIPTS) _gztest*
  301.     rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.log
  302.     rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs
  303.  
  304. mostlyclean: clean
  305.  
  306. distclean: clean
  307.     rm -f Makefile config.status
  308.  
  309. realclean: distclean
  310.     rm -f TAGS gzip.info* gzip.doc
  311.  
  312. dist: $(DISTFILES) Makefile
  313.     d=gzip-`sed -e '/VERSION/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' \
  314.                 -e q revision.h` ; \
  315.     rm -f ../$$d; \
  316.     ln -s `pwd` ../$$d; \
  317.     cd ..; \
  318.     files=""; \
  319.     for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
  320.     GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
  321.     rm -f $$d
  322.  
  323. zipdist: $(DISTFILES) Makefile
  324.     zip -u9T gzip`sed -e '/VERSION/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' \
  325.               -e s/[.]//g -e q revision.h` $(DISTFILES)
  326.  
  327. # Actual build-related targets
  328.  
  329. gzip$X:    Makefile $(OBJS)
  330.     $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
  331.     rm -f gunzip$X $(ZCAT)$X
  332.     ln gzip$X gunzip$X
  333.     ln gzip$X $(ZCAT)$X
  334.  
  335. gzip$O zip$O deflate$O trees$O bits$O unzip$O inflate$O: gzip.h tailor.h
  336. util$O lzw$O unlzw$O unpack$O unlzh$O crypt$O: gzip.h tailor.h
  337.  
  338. gzip$O unlzw$O: revision.h lzw.h
  339.  
  340. bits$O unzip$O util$O zip$O: crypt.h
  341.  
  342. gzip$O getopt$O: getopt.h
  343.  
  344. match$O: match.S
  345.     $(ASCPP) $(srcdir)/match.S > _match.s
  346.     $(CC) -c _match.s
  347.     mv _match$O match$O
  348.     rm -f _match.s
  349.  
  350. $(G)zdiff: zdiff.in
  351.     sed -e "$(SEDCMD)" -e "s|BINDIR|$(bindir)|" $(srcdir)/zdiff.in > $@
  352.     chmod 755 $@
  353.  
  354. $(G)zgrep: zgrep.in
  355.     sed -e "$(SEDCMD)" -e "s|BINDIR|$(bindir)|" $(srcdir)/zgrep.in > $@
  356.     chmod 755 $@
  357.  
  358. $(G)zmore: zmore.in
  359.     sed -e "$(SEDCMD)" -e "s|BINDIR|$(bindir)|" $(srcdir)/zmore.in > $@
  360.     chmod 755 $@
  361.  
  362. $(G)znew: znew.in
  363.     sed -e "$(SEDCMD)" -e "s|BINDIR|$(bindir)|" $(srcdir)/znew.in > $@
  364.     chmod 755 $@
  365.  
  366. $(G)zforce: zforce.in
  367.     sed -e "$(SEDCMD)" -e "s|BINDIR|$(bindir)|" $(srcdir)/zforce.in > $@
  368.     chmod 755 $@
  369.  
  370. gzexe: gzexe.in
  371.     sed -e "$(SEDCMD)" -e "s|BINDIR|$(bindir)|" $(srcdir)/gzexe.in > $@
  372.     chmod 755 $@
  373.  
  374. gzip.info: gzip.texi
  375.     cd $(srcdir); makeinfo gzip.texi
  376.  
  377. gzip.dvi: gzip.texi
  378.     cd $(srcdir); texi2dvi gzip.texi
  379.  
  380. gzip.doc: gzip.1
  381.     nroff -man $(srcdir)/gzip.1 | col -b | uniq > gzip.doc
  382.  
  383. # Prevent GNU make v3 from overflowing arg limit on SysV.
  384. .NOEXPORT:
  385.  
  386. # end of file
  387.